<?php


namespace App\Models;


use Illuminate\Database\Eloquent\Model;

class DriverFinancial extends Model
{
    use Common;

    protected $table = 'driver_financial';


    /**
     * 司机
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
     * @Author 姿势就是力量
     */
    public function driver()
    {
        return $this->belongsTo(Drivers::class, 'driver_id', 'id');
    }


    /**
     * 公司
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
     * @Author 姿势就是力量
     */
    public function corporation()
    {
        return $this->belongsTo(Company::class, 'company_id', 'id');
    }


    /**
     * 乘客
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
     * @Author 姿势就是力量
     */
    public function user()
    {
        return $this->belongsTo(User::class, 'user_id', 'id');
    }


    /**
     * 服务类型
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
     * @Author 姿势就是力量
     */
    public function service()
    {
        return $this->belongsTo(ServiceType::class, 'service_id', 'id');
    }


    /**
     * 车辆信息
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
     * @Author 姿势就是力量
     */
    public function car()
    {
        return $this->belongsTo(Car::class, 'car_id', 'id');
    }
}